package cn.schoolwow.quickdao.test.module.business.user.dml.user.flow.delete;

import cn.schoolwow.quickdao.domain.DAO;
import cn.schoolwow.quickdao.test.entity.User;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import org.junit.Assert;

public class CheckDeleteUserResultFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        DAO dao = flowContext.checkInstanceData(DAO.class);

        long count = dao.query(User.class)
                .execute()
                .count();
        Assert.assertEquals(0, count);
    }

    @Override
    public String name() {
        return "检查删除用户结果";
    }

}
